package com.manger.frame;

import javax.swing.*;
import java.awt.*;

/**
 * @ClassName ArrangeCaseFrame
 * @Description TODO
 * @Author @LiuHongJun
 * @Date 2025/9/6 12:21
 * @Version 1.0
 */
public class ArrangeCaseFrame {

    public void init(){
        // 创建 JFrame 实例
        JFrame frame = new JFrame("JComboBox Example");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(600, 200);

        // 创建 JPanel
        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(3, 2)); // 使用网格布局

        // 创建 JComboBox
        String[] items = {"Item 1", "Item 2", "Item 3"};
        JComboBox<String> comboBox = new JComboBox<>(items);
        comboBox.setPreferredSize(new Dimension(100, 20));
        // 添加 JLabel 和 JComboBox 到面板
        panel.add(new JLabel("项目："));
        panel.add(comboBox);

        panel.add(new JLabel("原始数据："));
        JButton jButton = new JButton("选择文件夹");
        jButton.setPreferredSize(new Dimension(100, 20));

        panel.add(jButton);

        panel.add(new JLabel("整理存放地址："));
        JButton jButton2 = new JButton("选择文件夹");
        jButton2.setPreferredSize(new Dimension(100, 20));
        panel.add(jButton2);

        // 将面板添加到框架中
        frame.add(panel);
        // 显示窗口
        frame.setVisible(true);

        frame.setResizable(false);

        /*for(int i = 0 ; i < frame.getContentPane().getComponentCount() ; i++){
            frame.getContentPane().getComponent(i).setPreferredSize(new Dimension(100, 45));
        }*/
    }
}
